#ifndef MQTTCLIENT_H
#define MQTTCLIENT_H

#include <QObject>
#include <QMutex>
#include <QtMqtt/QMqttClient>
#include <QtMqtt/QMqttTopicName>
#include <QJsonDocument>
#include <QJsonObject>

class MqttClient: public QObject
{
    Q_OBJECT
    Q_DISABLE_COPY(MqttClient)



public:
    explicit MqttClient();
    QMqttClient* m_client;
    static MqttClient& getInstance();

signals:
    void data_recived(QJsonObject new_temperature);

private:
    QString get_client_id();

    QJsonObject byteArreyToJsonObject(QByteArray data);
};

#endif // MQTTCLIENT_H
